 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKDisk/DiskModel.h>

@implementation DiskQuota
-(id) initWithLimit:(NSNumber*) limit
      used:(NSNumber*)used { 
     self.limit = limit;               
     self.used = used;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self limit])
    {
        [result setValue:[self limit] forKey:@"limit"];
    }
    if([self used])
    {
        [result setValue:[self used] forKey:@"used"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.limit = [dictionary objectForKey:@"limit"];
    self.used = [dictionary objectForKey:@"used"];
    return self;
}
 @end
@implementation DiskTagFilter
-(id) initWithKey:(NSString*) key
      values:(NSArray<NSString*>*)values { 
     self.key = key;               
     self.values = values;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self values])
    {
        [result setValue:[self values] forKey:@"values"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.key = [dictionary objectForKey:@"key"];
    self.values = [dictionary objectForKey:@"values"];
    return self;
}
 @end
@implementation ShareInfo
-(id) initWithShareTo:(NSString*) shareTo
      shareTime:(NSString*)shareTime { 
     self.shareTo = shareTo;               
     self.shareTime = shareTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self shareTo])
    {
        [result setValue:[self shareTo] forKey:@"shareTo"];
    }
    if([self shareTime])
    {
        [result setValue:[self shareTime] forKey:@"shareTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.shareTo = [dictionary objectForKey:@"shareTo"];
    self.shareTime = [dictionary objectForKey:@"shareTime"];
    return self;
}
 @end
@implementation DiskSpecification
-(id) initWithDiskType:(NSString*) diskType
      minSizeGB:(NSNumber*)minSizeGB
      maxSizeGB:(NSNumber*)maxSizeGB
      stepSizeGB:(NSNumber*)stepSizeGB
      descriptionValue:(NSString*)descriptionValue
      defaultIOPS:(NSNumber*)defaultIOPS
      stepIOPS:(NSNumber*)stepIOPS
      maxIOPS:(NSNumber*)maxIOPS
      defaultThroughput:(NSNumber*)defaultThroughput
      stepThroughput:(NSNumber*)stepThroughput
      maxThroughput:(NSNumber*)maxThroughput
      scalableIOPS:(NSNumber*)scalableIOPS
      maxStepIOPS:(NSNumber*)maxStepIOPS { 
     self.diskType = diskType;               
     self.minSizeGB = minSizeGB;               
     self.maxSizeGB = maxSizeGB;               
     self.stepSizeGB = stepSizeGB;               
     self.descriptionValue = descriptionValue;               
     self.defaultIOPS = defaultIOPS;               
     self.stepIOPS = stepIOPS;               
     self.maxIOPS = maxIOPS;               
     self.defaultThroughput = defaultThroughput;               
     self.stepThroughput = stepThroughput;               
     self.maxThroughput = maxThroughput;               
     self.scalableIOPS = scalableIOPS;               
     self.maxStepIOPS = maxStepIOPS;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self minSizeGB])
    {
        [result setValue:[self minSizeGB] forKey:@"minSizeGB"];
    }
    if([self maxSizeGB])
    {
        [result setValue:[self maxSizeGB] forKey:@"maxSizeGB"];
    }
    if([self stepSizeGB])
    {
        [result setValue:[self stepSizeGB] forKey:@"stepSizeGB"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self defaultIOPS])
    {
        [result setValue:[self defaultIOPS] forKey:@"defaultIOPS"];
    }
    if([self stepIOPS])
    {
        [result setValue:[self stepIOPS] forKey:@"stepIOPS"];
    }
    if([self maxIOPS])
    {
        [result setValue:[self maxIOPS] forKey:@"maxIOPS"];
    }
    if([self defaultThroughput])
    {
        [result setValue:[self defaultThroughput] forKey:@"defaultThroughput"];
    }
    if([self stepThroughput])
    {
        [result setValue:[self stepThroughput] forKey:@"stepThroughput"];
    }
    if([self maxThroughput])
    {
        [result setValue:[self maxThroughput] forKey:@"maxThroughput"];
    }
    if([self scalableIOPS])
    {
        [result setValue:[self scalableIOPS] forKey:@"scalableIOPS"];
    }
    if([self maxStepIOPS])
    {
        [result setValue:[self maxStepIOPS] forKey:@"maxStepIOPS"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.minSizeGB = [dictionary objectForKey:@"minSizeGB"];
    self.maxSizeGB = [dictionary objectForKey:@"maxSizeGB"];
    self.stepSizeGB = [dictionary objectForKey:@"stepSizeGB"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.defaultIOPS = [dictionary objectForKey:@"defaultIOPS"];
    self.stepIOPS = [dictionary objectForKey:@"stepIOPS"];
    self.maxIOPS = [dictionary objectForKey:@"maxIOPS"];
    self.defaultThroughput = [dictionary objectForKey:@"defaultThroughput"];
    self.stepThroughput = [dictionary objectForKey:@"stepThroughput"];
    self.maxThroughput = [dictionary objectForKey:@"maxThroughput"];
    self.scalableIOPS = [dictionary objectForKey:@"scalableIOPS"];
    self.maxStepIOPS = [dictionary objectForKey:@"maxStepIOPS"];
    return self;
}
 @end
@implementation Tag
-(id) initWithKey:(NSString*) key
      value:(NSString*)value { 
     self.key = key;               
     self.value = value;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self key])
    {
        [result setValue:[self key] forKey:@"key"];
    }
    if([self value])
    {
        [result setValue:[self value] forKey:@"value"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.key = [dictionary objectForKey:@"key"];
    self.value = [dictionary objectForKey:@"value"];
    return self;
}
 @end
@implementation Bind
-(id) initWithResourceId:(NSString*) resourceId { 
     self.resourceId = resourceId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    return self;
}
 @end
@implementation Soldout
-(id) initWithAzName:(NSString*) azName
      mediaType:(NSString*)mediaType
      isSoldOut:(NSNumber*)isSoldOut { 
     self.azName = azName;               
     self.mediaType = mediaType;               
     self.isSoldOut = isSoldOut;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self azName])
    {
        [result setValue:[self azName] forKey:@"azName"];
    }
    if([self mediaType])
    {
        [result setValue:[self mediaType] forKey:@"mediaType"];
    }
    if([self isSoldOut])
    {
        [result setValue:[self isSoldOut] forKey:@"isSoldOut"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.azName = [dictionary objectForKey:@"azName"];
    self.mediaType = [dictionary objectForKey:@"mediaType"];
    self.isSoldOut = [dictionary objectForKey:@"isSoldOut"];
    return self;
}
 @end
@implementation DiskAttachment
-(id) initWithAttachmentId:(NSString*) attachmentId
      diskId:(NSString*)diskId
      instanceType:(NSString*)instanceType
      instanceId:(NSString*)instanceId
      status:(NSString*)status
      attachTime:(NSString*)attachTime { 
     self.attachmentId = attachmentId;               
     self.diskId = diskId;               
     self.instanceType = instanceType;               
     self.instanceId = instanceId;               
     self.status = status;               
     self.attachTime = attachTime;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self attachmentId])
    {
        [result setValue:[self attachmentId] forKey:@"attachmentId"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self attachTime])
    {
        [result setValue:[self attachTime] forKey:@"attachTime"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.attachmentId = [dictionary objectForKey:@"attachmentId"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.status = [dictionary objectForKey:@"status"];
    self.attachTime = [dictionary objectForKey:@"attachTime"];
    return self;
}
 @end
@implementation SnapshotSpec
-(id) initWithName:(NSString*) name
      descriptionValue:(NSString*)descriptionValue
      diskId:(NSString*)diskId { 
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.diskId = diskId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    return self;
}
 @end
@implementation DiskSpec
-(id) initWithAz:(NSString*) az
      name:(NSString*)name
      descriptionValue:(NSString*)descriptionValue
      diskType:(NSString*)diskType
      diskSizeGB:(NSNumber*)diskSizeGB
      iops:(NSNumber*)iops
      snapshotId:(NSString*)snapshotId
      charge:(ChargeSpec*)charge
      multiAttachable:(NSNumber*)multiAttachable
      encrypt:(NSNumber*)encrypt { 
     self.az = az;               
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.diskType = diskType;               
     self.diskSizeGB = diskSizeGB;               
     self.iops = iops;               
     self.snapshotId = snapshotId;               
     self.charge = charge;               
     self.multiAttachable = multiAttachable;               
     self.encrypt = encrypt;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    if([self iops])
    {
        [result setValue:[self iops] forKey:@"iops"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    if([self multiAttachable])
    {
        [result setValue:[self multiAttachable] forKey:@"multiAttachable"];
    }
    if([self encrypt])
    {
        [result setValue:[self encrypt] forKey:@"encrypt"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.az = [dictionary objectForKey:@"az"];
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    self.iops = [dictionary objectForKey:@"iops"];
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    self.charge = [[ChargeSpec alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    self.multiAttachable = [dictionary objectForKey:@"multiAttachable"];
    self.encrypt = [dictionary objectForKey:@"encrypt"];
    return self;
}
 @end
@implementation Snapshot
-(id) initWithSnapshotId:(NSString*) snapshotId
      snapshotSource:(NSString*)snapshotSource
      diskId:(NSString*)diskId
      snapshotSizeGB:(NSNumber*)snapshotSizeGB
      images:(NSArray<NSString*>*)images
      name:(NSString*)name
      descriptionValue:(NSString*)descriptionValue
      status:(NSString*)status
      createTime:(NSString*)createTime
      sharInfo:(NSArray<ShareInfo*>*)sharInfo
      encrypted:(NSNumber*)encrypted { 
     self.snapshotId = snapshotId;               
     self.snapshotSource = snapshotSource;               
     self.diskId = diskId;               
     self.snapshotSizeGB = snapshotSizeGB;               
     self.images = images;               
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.status = status;               
     self.createTime = createTime;               
     self.sharInfo = sharInfo;               
     self.encrypted = encrypted;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    if([self snapshotSource])
    {
        [result setValue:[self snapshotSource] forKey:@"snapshotSource"];
    }
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    if([self snapshotSizeGB])
    {
        [result setValue:[self snapshotSizeGB] forKey:@"snapshotSizeGB"];
    }
    if([self images])
    {
        [result setValue:[self images] forKey:@"images"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self sharInfo])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self sharInfo] count]; i++) {
            ShareInfo* item = [[self sharInfo] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"sharInfo"];
    }
    if([self encrypted])
    {
        [result setValue:[self encrypted] forKey:@"encrypted"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    self.snapshotSource = [dictionary objectForKey:@"snapshotSource"];
    self.diskId = [dictionary objectForKey:@"diskId"];
    self.snapshotSizeGB = [dictionary objectForKey:@"snapshotSizeGB"];
    self.images = [dictionary objectForKey:@"images"];
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.status = [dictionary objectForKey:@"status"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    NSArray* sharInfoArray = [dictionary objectForKey:@"sharInfo"];
    if(sharInfoArray&&![sharInfoArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [sharInfoArray count];i++)
        {
            ShareInfo* item = [[ShareInfo alloc]initWithDic:[sharInfoArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.sharInfo = propertyArray;
    }
    self.encrypted = [dictionary objectForKey:@"encrypted"];
    return self;
}
 @end
@implementation Data
-(id) initWithResourceId:(NSString*) resourceId
      resourceName:(NSString*)resourceName
      bind:(NSArray<Bind*>*)bind { 
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.bind = bind;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self bind])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self bind] count]; i++) {
            Bind* item = [[self bind] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"bind"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    NSArray* bindArray = [dictionary objectForKey:@"bind"];
    if(bindArray&&![bindArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [bindArray count];i++)
        {
            Bind* item = [[Bind alloc]initWithDic:[bindArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.bind = propertyArray;
    }
    return self;
}
 @end
@implementation Disk
-(id) initWithDiskId:(NSString*) diskId
      az:(NSString*)az
      name:(NSString*)name
      descriptionValue:(NSString*)descriptionValue
      diskType:(NSString*)diskType
      diskSizeGB:(NSNumber*)diskSizeGB
      iops:(NSNumber*)iops
      throughput:(NSNumber*)throughput
      status:(NSString*)status
      attachments:(NSArray<DiskAttachment*>*)attachments
      snapshotId:(NSString*)snapshotId
      multiAttachable:(NSNumber*)multiAttachable
      encrypted:(NSNumber*)encrypted
      enabled:(NSNumber*)enabled
      createTime:(NSString*)createTime
      charge:(Charge*)charge
      tags:(NSArray<Tag*>*)tags { 
     self.diskId = diskId;               
     self.az = az;               
     self.name = name;               
     self.descriptionValue = descriptionValue;               
     self.diskType = diskType;               
     self.diskSizeGB = diskSizeGB;               
     self.iops = iops;               
     self.throughput = throughput;               
     self.status = status;               
     self.attachments = attachments;               
     self.snapshotId = snapshotId;               
     self.multiAttachable = multiAttachable;               
     self.encrypted = encrypted;               
     self.enabled = enabled;               
     self.createTime = createTime;               
     self.charge = charge;               
     self.tags = tags;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self diskId])
    {
        [result setValue:[self diskId] forKey:@"diskId"];
    }
    if([self az])
    {
        [result setValue:[self az] forKey:@"az"];
    }
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self descriptionValue])
    {
        [result setValue:[self descriptionValue] forKey:@"description"];
    }
    if([self diskType])
    {
        [result setValue:[self diskType] forKey:@"diskType"];
    }
    if([self diskSizeGB])
    {
        [result setValue:[self diskSizeGB] forKey:@"diskSizeGB"];
    }
    if([self iops])
    {
        [result setValue:[self iops] forKey:@"iops"];
    }
    if([self throughput])
    {
        [result setValue:[self throughput] forKey:@"throughput"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self attachments])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self attachments] count]; i++) {
            DiskAttachment* item = [[self attachments] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"attachments"];
    }
    if([self snapshotId])
    {
        [result setValue:[self snapshotId] forKey:@"snapshotId"];
    }
    if([self multiAttachable])
    {
        [result setValue:[self multiAttachable] forKey:@"multiAttachable"];
    }
    if([self encrypted])
    {
        [result setValue:[self encrypted] forKey:@"encrypted"];
    }
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self charge])
    {
        [result setValue:[[self charge] dictionary]forKey:@"charge"];
    }
    if([self tags])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self tags] count]; i++) {
            Tag* item = [[self tags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"tags"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.diskId = [dictionary objectForKey:@"diskId"];
    self.az = [dictionary objectForKey:@"az"];
    self.name = [dictionary objectForKey:@"name"];
    self.descriptionValue = [dictionary objectForKey:@"description"];
    self.diskType = [dictionary objectForKey:@"diskType"];
    self.diskSizeGB = [dictionary objectForKey:@"diskSizeGB"];
    self.iops = [dictionary objectForKey:@"iops"];
    self.throughput = [dictionary objectForKey:@"throughput"];
    self.status = [dictionary objectForKey:@"status"];
    NSArray* attachmentsArray = [dictionary objectForKey:@"attachments"];
    if(attachmentsArray&&![attachmentsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [attachmentsArray count];i++)
        {
            DiskAttachment* item = [[DiskAttachment alloc]initWithDic:[attachmentsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.attachments = propertyArray;
    }
    self.snapshotId = [dictionary objectForKey:@"snapshotId"];
    self.multiAttachable = [dictionary objectForKey:@"multiAttachable"];
    self.encrypted = [dictionary objectForKey:@"encrypted"];
    self.enabled = [dictionary objectForKey:@"enabled"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.charge = [[Charge alloc]initWithDic:[dictionary objectForKey:@"charge"]];
    NSArray* tagsArray = [dictionary objectForKey:@"tags"];
    if(tagsArray&&![tagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [tagsArray count];i++)
        {
            Tag* item = [[Tag alloc]initWithDic:[tagsArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.tags = propertyArray;
    }
    return self;
}
 @end
 
 


